package com.zkzx.truck.client;

import com.zkzx.common.truck.command.TruckCommand;
import com.zkzx.common.truck.model.TruckVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * 北京中科智兴物联科技有限公司 @版权所有
 *
 * @Author: zhaoyihe@zkraising.com
 * @Date: 2021/05/21/19:15
 * @Description:
 */
@FeignClient(value = "ZKZX-WLHY-ADAPTOR") // 本地调用 先以接口地址为准进行调用
//@FeignClient(name = "ZKZX-WLHY-ADAPTOR",url = "http://localhost:28084")
public interface WhAdaptorClient {

    @GetMapping("/ZKZX-WLHY-ADAPTOR/trucks/{id}")
    TruckCommand getTruck(@PathVariable("id") Integer id, @RequestParam("header_license") String headerLicense);


    @PostMapping("/ZKZX-WLHY-ADAPTOR/trucks/{id}")
    TruckCommand add(@PathVariable("id") Integer id, @RequestParam("company_three_id") String companyThreeId,@RequestBody @Valid TruckVO truckVO);

    @GetMapping("/ZKZX-WLHY-ADAPTOR/trucks/{id}/status")
    TruckCommand getStatus(@PathVariable("id") Integer id, @RequestParam("three_id") String threeId);

}
